<!DOCTYPE html>



  


<html class="theme-next pisces use-motion" lang="zh-Hans">
<head><meta name="generator" content="Hexo 3.8.0">
  <meta charset="UTF-8">
<!-- modify by zhangwei -->
<!-- 百度站长 -->
<meta name="baidu-site-verification" content="MdPKZBgY0U">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="theme-color" content="#222">









<meta http-equiv="Cache-Control" content="no-transform">
<meta http-equiv="Cache-Control" content="no-siteapp">



  <meta name="google-site-verification" content="8DKRuNxJDPU2k6cNyVhLe_eSqGk-R8oiYk8iKMg5gwI">














  
  
  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css">







<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css">

<link href="/css/main.css?v=5.1.4" rel="stylesheet" type="text/css">


  <link rel="apple-touch-icon" sizes="180x180" href="/uploads/favicon.ico?v=5.1.4">


  <link rel="icon" type="image/png" sizes="32x32" href="/uploads/favicon.ico?v=5.1.4">


  <link rel="icon" type="image/png" sizes="16x16" href="/uploads/favicon.ico?v=5.1.4">


  <link rel="mask-icon" href="/uploads/favicon.ico?v=5.1.4" color="#222">





  <meta name="keywords" content="Android,热修复,Sophix,">





  <link rel="alternate" href="/atom.xml" title="班德尔城" type="application/atom+xml">






<meta name="description" content="以往当Android App出现bug的时候，甚至仅仅是修改一行代码，都要重新发布新版本对bug进行修复，这样带来的缺点是明显的，需要用户重新升级app，覆盖率太慢，成本太高。所以就出现了热修复技术，通过打补丁的方式，通过从服务器下载补丁包，然后对有问题的类中出问题的方法，进行替换，优点是用户无感知修复，无需下载新的应用，代价小。对比其他的热修复方案，来耍一耍阿里-Sophix 。">
<meta name="keywords" content="Android,热修复,Sophix">
<meta property="og:type" content="article">
<meta property="og:title" content="Android热修复-Sophix">
<meta property="og:url" content="https://tiimor.cn/Android热修复-Sophix/index.html">
<meta property="og:site_name" content="班德尔城">
<meta property="og:description" content="以往当Android App出现bug的时候，甚至仅仅是修改一行代码，都要重新发布新版本对bug进行修复，这样带来的缺点是明显的，需要用户重新升级app，覆盖率太慢，成本太高。所以就出现了热修复技术，通过打补丁的方式，通过从服务器下载补丁包，然后对有问题的类中出问题的方法，进行替换，优点是用户无感知修复，无需下载新的应用，代价小。对比其他的热修复方案，来耍一耍阿里-Sophix 。">
<meta property="og:locale" content="zh-Hans">
<meta property="og:image" content="http://cdn.tiimor.cn/images/%E5%94%AF%E7%BE%8E%E7%AF%87%EF%BC%8D%E7%94%BB%E4%B8%AD%E7%9A%84android.jpg">
<meta property="og:image" content="http://cdn.tiimor.cn/images/%E6%B7%BB%E5%8A%A0%E7%A7%BB%E5%8A%A8%E7%83%AD%E4%BF%AE%E5%A4%8D.png">
<meta property="og:image" content="http://cdn.tiimor.cn/images/Sophix%E6%B5%8B%E8%AF%95.png">
<meta property="og:image" content="http://cdn.tiimor.cn/images/Sophix%E5%BF%85%E8%A6%81%E4%BF%A1%E6%81%AF.png">
<meta property="og:image" content="http://cdn.tiimor.cn/images/%E5%BC%95%E5%85%A5Sophix%E4%BB%93%E5%BA%93.png">
<meta property="og:image" content="http://cdn.tiimor.cn/images/gif-Sophix.gif">
<meta property="og:image" content="http://cdn.tiimor.cn/images/Sophix_V1.png">
<meta property="og:image" content="http://cdn.tiimor.cn/images/Sophix_V2.png">
<meta property="og:image" content="http://cdn.tiimor.cn/images/Sophix%E8%A1%A5%E4%B8%81%E7%94%9F%E6%88%90.png">
<meta property="og:image" content="http://cdn.tiimor.cn/images/Sophix%E6%B7%BB%E5%8A%A0%E8%A1%A5%E4%B8%81%E7%89%88%E6%9C%AC.png">
<meta property="og:image" content="http://cdn.tiimor.cn/images/Sophix%E4%B8%8A%E4%BC%A0%E8%A1%A5%E4%B8%81.png">
<meta property="og:image" content="http://cdn.tiimor.cn/images/Sophix%E6%9C%AC%E5%9C%B0%E6%B5%8B%E8%AF%95.png">
<meta property="og:image" content="http://cdn.tiimor.cn/images/Sophix%E6%9C%AC%E5%9C%B0%E6%B5%8B%E8%AF%95%E6%88%90%E5%8A%9F.png">
<meta property="og:image" content="http://cdn.tiimor.cn/images/Sophix%E5%8F%91%E5%B8%83.png">
<meta property="og:image" content="https://ww4.sinaimg.cn/large/e724cbefgw1etyppy7bgwg2001001017.gif">
<meta property="og:image" content="http://cdn.tiimor.cn/images/%E9%98%BF%E9%87%8C%E7%83%AD%E4%BF%AE%E5%A4%8D%E5%8E%9F%E7%90%86%E5%AE%9D%E5%85%B8.png">
<meta property="og:updated_time" content="2019-03-17T06:47:42.366Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Android热修复-Sophix">
<meta name="twitter:description" content="以往当Android App出现bug的时候，甚至仅仅是修改一行代码，都要重新发布新版本对bug进行修复，这样带来的缺点是明显的，需要用户重新升级app，覆盖率太慢，成本太高。所以就出现了热修复技术，通过打补丁的方式，通过从服务器下载补丁包，然后对有问题的类中出问题的方法，进行替换，优点是用户无感知修复，无需下载新的应用，代价小。对比其他的热修复方案，来耍一耍阿里-Sophix 。">
<meta name="twitter:image" content="http://cdn.tiimor.cn/images/%E5%94%AF%E7%BE%8E%E7%AF%87%EF%BC%8D%E7%94%BB%E4%B8%AD%E7%9A%84android.jpg">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Pisces',
    version: '5.1.4',
    sidebar: {"position":"left","display":"post","offset":12,"b2t":false,"scrollpercent":true,"onmobile":false},
    fancybox: true,
    tabs: true,
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: '3AUIZWGETM',
      apiKey: '5fcd6d51d892fffe3480c5b37f5fd4fa',
      indexName: 'Tiimor',
      hits: {"per_page":8},
      labels: {"input_placeholder":"搜索","hits_empty":"未发现与「${query}」相关的内容","hits_stats":"${hits} 条相关条目，使用了 ${time} 毫秒"}
    }
  };
</script>



  <link rel="canonical" href="https://tiimor.cn/Android热修复-Sophix/">





  <title>Android热修复-Sophix | 班德尔城</title>
  




<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
            (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
          m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
  ga('create', 'UA-96457043-1', 'auto');
  ga('send', 'pageview');
</script>


  <script type="text/javascript">
    var _hmt = _hmt || [];
    (function() {
      var hm = document.createElement("script");
      hm.src = "https://hm.baidu.com/hm.js?abb97f8f68c9e5eb2217d3111c64e696";
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(hm, s);
    })();
  </script>




</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">

  
  
    
  

  <div class="container sidebar-position-left page-post-detail">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

  <!-- modify by zhangwei -->
  <!-- 下雪的动画 -->
  <div class="canvas-snow">
    <canvas id="canvas" style="margin: 0;  padding: 0;top:0; left: 0; right: 0; background: transparent; position: absolute;" width="1366" height="105"></canvas>
      <script>

      var canvasBgImg = {
        start: function () {
          this.canvas = document.getElementById('canvas')
          this.ctx = this.canvas.getContext("2d")
          this.canvas.width = window.innerWidth
          this.canvas.height = 105
          this.starList = []
        },
        drawLine: function (ctx, x1, y1, x2, y2) {
          ctx.beginPath()
          ctx.strokeStyle = '#ffffff'
          ctx.lineTo(x1, y1)
          ctx.lineTo(x2, y2)
          ctx.stroke()
        },
        canvasSingleSnow: function (snowSize) {
          var singleSnow = document.createElement('canvas'),
            ctxSingle = singleSnow.getContext('2d')
          singleSnow.setAttribute('width', snowSize * 2)
          singleSnow.setAttribute('height', snowSize * 2)
          for (var i = 0; i < 6; i++) {
            ctxSingle.save()
            ctxSingle.translate(snowSize, snowSize)
            ctxSingle.rotate(Math.PI * 2 * i / 6)
            this.drawLine(ctxSingle, 0, 0, snowSize, 0)
            ctxSingle.restore()
          }
          return singleSnow
        },
        canvasAllSnow: function (centerSnow) {
          var canvasSnow = document.createElement('canvas'),
            ctxSnow = canvasSnow.getContext('2d'),
            bigSnow = this.canvasSingleSnow(centerSnow),
            smallSnow = this.canvasSingleSnow(centerSnow / 3),
            sizeSnow = centerSnow * 3 / 5,
            rSnow = centerSnow - sizeSnow / 2
          canvasSnow.setAttribute('width', centerSnow * 2)
          canvasSnow.setAttribute('height', centerSnow * 2)
          ctxSnow.drawImage(bigSnow, 0, 0, bigSnow.width, bigSnow.height, 0, 0, centerSnow * 2, centerSnow * 2)
          for (var i = 0; i < 6; i++) {
            ctxSnow.save()
            ctxSnow.translate(centerSnow, centerSnow)
            ctxSnow.rotate(Math.PI * 2 * i / 6)
            ctxSnow.drawImage(smallSnow, 0, 0, smallSnow.width, smallSnow.height, rSnow - sizeSnow / 2,
              -sizeSnow / 2, sizeSnow, sizeSnow)
            ctxSnow.restore()
          }
          return canvasSnow
        },
        init: function () {
          this.start()
          for (var i = 0; i < 75; i++) {
            this.starList.push({
              drawFunc: this.canvasAllSnow(15),
              width: Math.random() * this.canvas.width,
              height: Math.random() * this.canvas.height,
              speed: Math.random() * 1.5 + .5,
              scale: Math.random() * 12 + 5,
              angel: 0
            })
          }
          var self = this,
            loop = function () {
              self.ctx.clearRect(0, 0, self.canvas.width, self.canvas.width)
              for (var i = 0; i < 75; i++) {
                self.ctx.save()
                self.starList[i].height = self.starList[i].height + self.starList[i].speed
                self.starList[i].angel += 2
                self.ctx.translate(self.starList[i].width, self.starList[i].height)
                self.ctx.rotate(self.starList[i].angel * Math.PI / 360)
                self.ctx.translate(-self.starList[i].width, -self.starList[i].height)
                self.ctx.drawImage(self.starList[i].drawFunc, 0, 0,
                  self.starList[i].drawFunc.width, self.starList[i].drawFunc.height,
                  self.starList[i].width - self.starList[i].scale / 2,
                  self.starList[i].height - self.starList[i].scale / 2,
                  self.starList[i].scale, self.starList[i].scale)
                if (self.starList[i].height > self.canvas.height) {
                  self.starList[i] = Object.assign(self.starList[i], {
                    height: -self.starList[i].scale,
                    width: Math.random() * this.canvas.width
                  })
                }
                self.ctx.restore()
              }
              requestAnimationFrame(loop)
            }
          requestAnimationFrame(loop)
        }
      }
      canvasBgImg.init()
      </script>

    </div>


    <div class="custom-logo-site-title">
      <a href="/" class="brand" rel="start">
        <!-- modify by zhangwei -->
        <!-- 圣诞帽 -->
        <img src="/uploads/santa-hat.png" id="santa" style="height: 41px; position: absolute; left: -40px; top: -20px; transform: rotate(-45deg); z-index: 9000;">

        <span class="logo-line-before"><i></i></span>
        <span class="site-title">班德尔城</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <p class="site-subtitle">微笑，简单，奋发</p>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br>
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/archives/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br>
            
            归档
          </a>
        </li>
      
        
        <li class="menu-item menu-item-about">
          <a href="/about/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-user"></i> <br>
            
            关于
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/tags/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br>
            
            标签
          </a>
        </li>
      
        
        <li class="menu-item menu-item-guestbook">
          <a href="/guestbook" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-send"></i> <br>
            
            留言
          </a>
        </li>
      
        
        <li class="menu-item menu-item-favourite">
          <a href="/favourite" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-bookmark"></i> <br>
            
            收藏
          </a>
        </li>
      

      
        <li class="menu-item menu-item-search">
          
            <a href="javascript:;" class="popup-trigger">
          
            
              <i class="menu-item-icon fa fa-search fa-fw"></i> <br>
            
            搜索
          </a>
        </li>
      
    </ul>
  

  
    <div class="site-search">
      
  
  <div class="algolia-popup popup search-popup">
    <div class="algolia-search">
      <div class="algolia-search-input-icon">
        <i class="fa fa-search"></i>
      </div>
      <div class="algolia-search-input" id="algolia-search-input"></div>
    </div>

    <div class="algolia-results">
      <div id="algolia-stats"></div>
      <div id="algolia-hits"></div>
      <div id="algolia-pagination" class="algolia-pagination"></div>
    </div>

    <span class="popup-btn-close">
      <i class="fa fa-times-circle"></i>
    </span>
  </div>




    </div>
  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="https://tiimor.cn/Android热修复-Sophix/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="Tiimor">
      <meta itemprop="description" content>
      <meta itemprop="image" content="/uploads/avatar.jpg">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="班德尔城">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">Android热修复-Sophix</h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="创建于" itemprop="dateCreated datePublished" datetime="2017-09-17T11:52:10+08:00">
                2017-09-17
              </time>
            

            

            
          </span>

          
            <span class="post-category">
            
              <span class="post-meta-divider">|</span>
            
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/好好学习/" itemprop="url" rel="index">
                    <span itemprop="name">好好学习</span>
                  </a>
                </span>

                
                
              
            </span>
          

          
            
              <span class="post-comments-count">
                <span class="post-meta-divider">|</span>
                <span class="post-meta-item-icon">
                  <i class="fa fa-comment-o"></i>
                </span>
                <a href="/Android热修复-Sophix/#comments" itemprop="discussionUrl">
                  <span class="post-comments-count gitment-comments-count" data-xid="/Android热修复-Sophix/" itemprop="commentsCount"></span>
                </a>
              </span>
            
          

          
          
             <span id="/Android热修复-Sophix/" class="leancloud_visitors" data-flag-title="Android热修复-Sophix">
               <span class="post-meta-divider">|</span>
               <!-- modify by zhangwei -->
               <!-- 去掉阅读的眼睛图标，阅读次数改为℃ -->
			   
                 <span class="post-meta-item-text">热度 </span>
               
                 <span class="leancloud-visitors-count"></span>
				 <span>℃</span>
             </span>
          

          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        <p><img src="http://cdn.tiimor.cn/images/%E5%94%AF%E7%BE%8E%E7%AF%87%EF%BC%8D%E7%94%BB%E4%B8%AD%E7%9A%84android.jpg" alt="Android" title="&#x753B;&#x4E2D;&#x7684;android"></p>
<p>&#x4EE5;&#x5F80;&#x5F53;Android App&#x51FA;&#x73B0;bug&#x7684;&#x65F6;&#x5019;&#xFF0C;&#x751A;&#x81F3;&#x4EC5;&#x4EC5;&#x662F;&#x4FEE;&#x6539;&#x4E00;&#x884C;&#x4EE3;&#x7801;&#xFF0C;&#x90FD;&#x8981;&#x91CD;&#x65B0;&#x53D1;&#x5E03;&#x65B0;&#x7248;&#x672C;&#x5BF9;bug&#x8FDB;&#x884C;&#x4FEE;&#x590D;&#xFF0C;&#x8FD9;&#x6837;&#x5E26;&#x6765;&#x7684;&#x7F3A;&#x70B9;&#x662F;&#x660E;&#x663E;&#x7684;&#xFF0C;&#x9700;&#x8981;&#x7528;&#x6237;&#x91CD;&#x65B0;&#x5347;&#x7EA7;app&#xFF0C;&#x8986;&#x76D6;&#x7387;&#x592A;&#x6162;&#xFF0C;&#x6210;&#x672C;&#x592A;&#x9AD8;&#x3002;&#x6240;&#x4EE5;&#x5C31;&#x51FA;&#x73B0;&#x4E86;&#x70ED;&#x4FEE;&#x590D;&#x6280;&#x672F;&#xFF0C;&#x901A;&#x8FC7;&#x6253;&#x8865;&#x4E01;&#x7684;&#x65B9;&#x5F0F;&#xFF0C;&#x901A;&#x8FC7;&#x4ECE;&#x670D;&#x52A1;&#x5668;&#x4E0B;&#x8F7D;&#x8865;&#x4E01;&#x5305;&#xFF0C;&#x7136;&#x540E;&#x5BF9;&#x6709;&#x95EE;&#x9898;&#x7684;&#x7C7B;&#x4E2D;&#x51FA;&#x95EE;&#x9898;&#x7684;&#x65B9;&#x6CD5;&#xFF0C;&#x8FDB;&#x884C;&#x66FF;&#x6362;&#xFF0C;&#x4F18;&#x70B9;&#x662F;&#x7528;&#x6237;&#x65E0;&#x611F;&#x77E5;&#x4FEE;&#x590D;&#xFF0C;&#x65E0;&#x9700;&#x4E0B;&#x8F7D;&#x65B0;&#x7684;&#x5E94;&#x7528;&#xFF0C;&#x4EE3;&#x4EF7;&#x5C0F;&#x3002;&#x5BF9;&#x6BD4;&#x5176;&#x4ED6;&#x7684;&#x70ED;&#x4FEE;&#x590D;&#x65B9;&#x6848;&#xFF0C;<strong>&#x6765;&#x800D;&#x4E00;&#x800D;&#x963F;&#x91CC;-Sophix</strong> &#x3002;</p>
<a id="more"></a>
<h2 id="&#x4ECB;&#x7ECD;"><a href="#&#x4ECB;&#x7ECD;" class="headerlink" title="&#x4ECB;&#x7ECD;"></a>&#x4ECB;&#x7ECD;</h2><h3 id="&#x201C;&#x51B7;&#x70ED;&#x201D;"><a href="#&#x201C;&#x51B7;&#x70ED;&#x201D;" class="headerlink" title="&#x201C;&#x51B7;&#x70ED;&#x201D;"></a>&#x201C;&#x51B7;&#x70ED;&#x201D;</h3><ul>
<li><strong>&#x63D2;&#x4EF6;&#x5316;</strong> - apk &#x5206;&#x4E3A;&#x5BBF;&#x4E3B;&#x548C;&#x63D2;&#x4EF6;&#x90E8;&#x5206;&#xFF0C;&#x63D2;&#x4EF6;&#x5728;&#x9700;&#x8981;&#x7684;&#x65F6;&#x5019;&#x624D;&#x52A0;&#x8F7D;&#x8FDB;&#x6765;</li>
<li><strong>&#x70ED;&#x4FEE;&#x590D;</strong> &#x2013; &#x66F4;&#x65B0;&#x7684;&#x7C7B;&#x6216;&#x8005;&#x63D2;&#x4EF6;&#x7C92;&#x5EA6;&#x8F83;&#x5C0F;&#x7684;&#x65F6;&#x5019;&#xFF0C;&#x6211;&#x4EEC;&#x4F1A;&#x79F0;&#x4E4B;&#x4E3A;&#x70ED;&#x4FEE;&#x590D;&#xFF0C;&#x4E00;&#x822C;&#x7528;&#x4E8E;&#x4FEE;&#x590D;bug</li>
<li><strong>&#x70ED;&#x66F4;&#x65B0;</strong> &#x2013; 2016 Google &#x7684; Android Studio &#x63A8;&#x51FA;&#x4E86;Instant Run &#x529F;&#x80FD; &#x540C;&#x65F6;&#x63D0;&#x51FA;&#x4E86;3&#x4E2A;&#x540D;&#x8BCD;</li>
<li><strong>&#x70ED;&#x90E8;&#x7F72;</strong> &#x2013; &#x65B9;&#x6CD5;&#x5185;&#x7684;&#x7B80;&#x5355;&#x4FEE;&#x6539;&#xFF0C;&#x65E0;&#x9700;&#x91CD;&#x542F;app&#x548C;Activity&#x3002; </li>
<li><strong>&#x6696;&#x90E8;&#x7F72;</strong> &#x2013; app&#x65E0;&#x9700;&#x91CD;&#x542F;&#xFF0C;&#x4F46;&#x662F;activity&#x9700;&#x8981;&#x91CD;&#x542F;&#xFF0C;&#x6BD4;&#x5982;&#x8D44;&#x6E90;&#x7684;&#x4FEE;&#x6539;&#x3002; </li>
<li><strong>&#x51B7;&#x90E8;&#x7F72;</strong> &#x2013; app&#x9700;&#x8981;&#x91CD;&#x542F;&#xFF0C;&#x6BD4;&#x5982;&#x7EE7;&#x627F;&#x5173;&#x7CFB;&#x7684;&#x6539;&#x53D8;&#x6216;&#x65B9;&#x6CD5;&#x7684;&#x7B7E;&#x540D;&#x53D8;&#x5316;&#x7B49;&#x3002;</li>
</ul>
<h3 id="&#x70ED;&#x4FEE;&#x590D;&#x7279;&#x70B9;"><a href="#&#x70ED;&#x4FEE;&#x590D;&#x7279;&#x70B9;" class="headerlink" title="&#x70ED;&#x4FEE;&#x590D;&#x7279;&#x70B9;"></a>&#x70ED;&#x4FEE;&#x590D;&#x7279;&#x70B9;</h3><ul>
<li>&#x65E0;&#x9700;&#x91CD;&#x65B0;&#x53D1;&#x7248;&#xFF0C;&#x5B9E;&#x65F6;&#x9AD8;&#x6548;&#x70ED;&#x4FEE;&#x590D;</li>
<li>&#x7528;&#x6237;&#x65E0;&#x611F;&#x77E5;&#x4FEE;&#x590D;&#xFF0C;&#x65E0;&#x9700;&#x4E0B;&#x8F7D;&#x65B0;&#x7684;&#x5E94;&#x7528;&#xFF0C;&#x65E0;&#x9700;&#x91CD;&#x88C5;App&#xFF0C;&#x4EE3;&#x4EF7;&#x5C0F;</li>
<li>&#x4FEE;&#x590D;&#x6210;&#x529F;&#x7387;&#x9AD8;&#xFF0C;&#x628A;&#x635F;&#x5931;&#x964D;&#x5230;&#x6700;&#x4F4E;</li>
</ul>
<h3 id="&#x963F;&#x91CC;&#x70ED;&#x4FEE;&#x590D;&#x65B9;&#x6848;&#x5BF9;&#x6BD4;"><a href="#&#x963F;&#x91CC;&#x70ED;&#x4FEE;&#x590D;&#x65B9;&#x6848;&#x5BF9;&#x6BD4;" class="headerlink" title="&#x963F;&#x91CC;&#x70ED;&#x4FEE;&#x590D;&#x65B9;&#x6848;&#x5BF9;&#x6BD4;"></a>&#x963F;&#x91CC;&#x70ED;&#x4FEE;&#x590D;&#x65B9;&#x6848;&#x5BF9;&#x6BD4;</h3><table>
<thead>
<tr>
<th>&#x65B9;&#x6848;&#x5BF9;&#x6BD4;</th>
<th><a href="https://github.com/alibaba/AndFix" target="_blank" rel="noopener">Andfix&#x5F00;&#x6E90;&#x7248;&#x672C;</a></th>
<th>&#x963F;&#x91CC;Hotfix 1.X</th>
<th><a href="https://github.com/aliyun/alicloud-android-demo/tree/master/hotfix_android_demo" target="_blank" rel="noopener">&#x963F;&#x91CC;Hotfix&#x6700;&#x65B0;&#x7248; (Sophix)</a></th>
</tr>
</thead>
<tbody>
<tr>
<td>&#x65B9;&#x6CD5;&#x66FF;&#x6362;</td>
<td>&#x652F;&#x6301;&#xFF0C;&#x9664;&#x90E8;&#x5206;&#x60C5;&#x51B5;[0]</td>
<td>&#x652F;&#x6301;&#xFF0C;&#x9664;&#x90E8;&#x5206;&#x60C5;&#x51B5;</td>
<td>&#x5168;&#x90E8;&#x652F;&#x6301;</td>
</tr>
<tr>
<td>&#x65B9;&#x6CD5;&#x589E;&#x52A0;&#x51CF;&#x5C11;</td>
<td>&#x4E0D;&#x652F;&#x6301;</td>
<td>&#x4E0D;&#x652F;&#x6301;</td>
<td>&#x4EE5;&#x51B7;&#x542F;&#x52A8;&#x65B9;&#x5F0F;&#x652F;&#x6301;[1]</td>
</tr>
<tr>
<td>&#x65B9;&#x6CD5;&#x53CD;&#x5C04;&#x8C03;&#x7528;</td>
<td>&#x53EA;&#x652F;&#x6301;&#x9759;&#x6001;&#x65B9;&#x6CD5;</td>
<td>&#x53EA;&#x652F;&#x6301;&#x9759;&#x6001;&#x65B9;&#x6CD5;</td>
<td>&#x4EE5;&#x51B7;&#x542F;&#x52A8;&#x65B9;&#x5F0F;&#x652F;&#x6301;</td>
</tr>
<tr>
<td>&#x5373;&#x65F6;&#x751F;&#x6548;</td>
<td>&#x652F;&#x6301;</td>
<td>&#x652F;&#x6301;</td>
<td>&#x89C6;&#x60C5;&#x51B5;&#x652F;&#x6301;[2]</td>
</tr>
<tr>
<td>&#x591A;DEX</td>
<td>&#x4E0D;&#x652F;&#x6301;</td>
<td>&#x652F;&#x6301;</td>
<td>&#x652F;&#x6301;</td>
</tr>
<tr>
<td>&#x8D44;&#x6E90;&#x66F4;&#x65B0;</td>
<td>&#x4E0D;&#x652F;&#x6301;</td>
<td>&#x4E0D;&#x652F;&#x6301;</td>
<td>&#x652F;&#x6301;</td>
</tr>
<tr>
<td>so&#x5E93;&#x66F4;&#x65B0;</td>
<td>&#x4E0D;&#x652F;&#x6301;</td>
<td>&#x4E0D;&#x652F;&#x6301;</td>
<td>&#x652F;&#x6301;</td>
</tr>
<tr>
<td>Android&#x7248;&#x672C;</td>
<td>&#x652F;&#x6301;2.3~7.0</td>
<td>&#x652F;&#x6301;2.3~6.0</td>
<td>&#x5168;&#x90E8;&#x652F;&#x6301;&#x5305;&#x542B;7.0&#x4EE5;&#x4E0A;</td>
</tr>
<tr>
<td>&#x5DF2;&#x6709;&#x673A;&#x578B;</td>
<td>&#x5927;&#x90E8;&#x5206;&#x652F;&#x6301;[3]</td>
<td>&#x5927;&#x90E8;&#x5206;&#x652F;&#x6301;</td>
<td>&#x5168;&#x90E8;&#x652F;&#x6301;</td>
</tr>
<tr>
<td>&#x5B89;&#x5168;&#x673A;&#x5236;</td>
<td>&#x65E0;</td>
<td>&#x52A0;&#x5BC6;&#x4F20;&#x8F93;&#x53CA;&#x7B7E;&#x540D;&#x6821;&#x9A8C;</td>
<td>&#x52A0;&#x5BC6;&#x4F20;&#x8F93;&#x53CA;&#x7B7E;&#x540D;&#x6821;&#x9A8C;</td>
</tr>
<tr>
<td>&#x6027;&#x80FD;&#x635F;&#x8017;</td>
<td>&#x4F4E;&#xFF0C;&#x51E0;&#x4E4E;&#x65E0;&#x635F;&#x8017;</td>
<td>&#x4F4E;&#xFF0C;&#x51E0;&#x4E4E;&#x65E0;&#x635F;&#x8017;</td>
<td>&#x4F4E;&#xFF0C;&#x4EC5;&#x51B7;&#x542F;&#x52A8;&#x60C5;&#x51B5;&#x4E0B;&#x6709;&#x4E9B;&#x635F;&#x8017;</td>
</tr>
<tr>
<td>&#x751F;&#x6210;&#x8865;&#x4E01;</td>
<td>&#x7E41;&#x7410;&#xFF0C;&#x547D;&#x4EE4;&#x884C;&#x64CD;&#x4F5C;</td>
<td>&#x7E41;&#x7410;&#xFF0C;&#x547D;&#x4EE4;&#x884C;&#x64CD;&#x4F5C;</td>
<td>&#x4FBF;&#x6377;&#xFF0C;&#x56FE;&#x5F62;&#x5316;&#x754C;&#x9762;</td>
</tr>
<tr>
<td>&#x8865;&#x4E01;&#x5927;&#x5C0F;</td>
<td>&#x4E0D;&#x5927;&#xFF0C;&#x4EC5;&#x53D8;&#x52A8;&#x7684;&#x7C7B;</td>
<td>&#x5C0F;&#xFF0C;&#x4EC5;&#x53D8;&#x52A8;&#x7684;&#x65B9;&#x6CD5;</td>
<td>&#x4E0D;&#x5927;&#xFF0C;&#x4EC5;&#x53D8;&#x52A8;&#x7684;&#x8D44;&#x6E90;&#x548C;&#x4EE3;&#x7801;[4]</td>
</tr>
<tr>
<td>&#x670D;&#x52A1;&#x7AEF;&#x652F;&#x6301;</td>
<td>&#x65E0;</td>
<td>&#x652F;&#x6301;&#x670D;&#x52A1;&#x7AEF;&#x63A7;&#x5236;[5]</td>
<td>&#x652F;&#x6301;&#x670D;&#x52A1;&#x7AEF;&#x63A7;&#x5236;</td>
</tr>
</tbody>
</table>
<p>&#x8BF4;&#x660E;&#xFF1A;</p>
<ul>
<li>[0] &#x90E8;&#x5206;&#x60C5;&#x51B5;&#x6307;&#x7684;&#x662F;&#x6784;&#x9020;&#x65B9;&#x6CD5;&#x3001;&#x53C2;&#x6570;&#x6570;&#x76EE;&#x5927;&#x4E8E;8&#x6216;&#x8005;&#x53C2;&#x6570;&#x5305;&#x62EC;long,double,float&#x57FA;&#x672C;&#x7C7B;&#x578B;&#x7684;&#x65B9;&#x6CD5;&#x3002;</li>
<li>[1] &#x51B7;&#x542F;&#x52A8;&#x65B9;&#x5F0F;&#xFF0C;&#x6307;&#x7684;&#x662F;&#x9700;&#x8981;&#x91CD;&#x542F;app&#x5728;&#x4E0B;&#x6B21;&#x542F;&#x52A8;&#x65F6;&#x624D;&#x80FD;&#x751F;&#x6548;&#x3002; </li>
<li>[2] &#x5BF9;&#x4E8E;Andfix&#x53CA;Hotfix 1.X&#x80FD;&#x591F;&#x652F;&#x6301;&#x7684;&#x4EE3;&#x7801;&#x53D8;&#x52A8;&#x60C5;&#x51B5;&#xFF0C;&#x90FD;&#x80FD;&#x505A;&#x5230;&#x5373;&#x65F6;&#x751F;&#x6548;&#x3002;&#x800C;&#x5BF9;&#x4E8E;&#x5176;&#x4ED6;&#x4EE3;&#x7801;&#x53D8;&#x52A8;&#x8F83;&#x5927;&#x7684;&#x60C5;&#x51B5;&#xFF0C;&#x4F1A;&#x8D70;&#x51B7;&#x542F;&#x52A8;&#x65B9;&#x5F0F;&#xFF0C;&#x6B64;&#x65F6;&#x5C31;&#x65E0;&#x6CD5;&#x505A;&#x5230;&#x5373;&#x65F6;&#x751F;&#x6548;&#x3002; </li>
<li>[3] Hotfix 1.X&#x5DF2;&#x7ECF;&#x652F;&#x6301;&#x7EDD;&#x5927;&#x90E8;&#x5206;&#x4E3B;&#x6D41;&#x624B;&#x673A;&#xFF0C;&#x53EA;&#x662F;&#x5728;X86&#x8BBE;&#x5907;&#x4EE5;&#x53CA;&#x4FEE;&#x6539;&#x4E86;&#x865A;&#x62DF;&#x673A;&#x5E95;&#x5C42;&#x7ED3;&#x6784;&#x7684;ROM&#x4E0A;&#x4E0D;&#x652F;&#x6301;&#x3002; </li>
<li>[4] &#x7531;&#x4E8E;&#x652F;&#x6301;&#x4E86;&#x8D44;&#x6E90;&#x548C;&#x5E93;&#xFF0C;&#x5982;&#x679C;&#x6709;&#x8FD9;&#x4E9B;&#x65B9;&#x9762;&#x7684;&#x66F4;&#x65B0;&#xFF0C;&#x5C31;&#x4F1A;&#x5BFC;&#x81F4;&#x7684;&#x8865;&#x4E01;&#x53D8;&#x5927;&#x4E00;&#x4E9B;&#xFF0C;&#x8FD9;&#x4E2A;&#x662F;&#x5F88;&#x6B63;&#x5E38;&#x7684;&#x3002;&#x5E76;&#x4E14;&#x7531;&#x4E8E;&#x53EA;&#x5305;&#x542B;&#x5DEE;&#x5F02;&#x7684;&#x90E8;&#x5206;&#xFF0C;&#x6240;&#x4EE5;&#x8865;&#x4E01;&#x5DF2;&#x7ECF;&#x662F;&#x6700;&#x5927;&#x7A0B;&#x5EA6;&#x7684;&#x5C0F;&#x4E86;&#x3002; </li>
<li>[5] &#x63D0;&#x4F9B;&#x670D;&#x52A1;&#x7AEF;&#x7684;&#x8865;&#x4E01;&#x53D1;&#x5E03;&#x548C;&#x505C;&#x53D1;&#x3001;&#x7248;&#x672C;&#x63A7;&#x5236;&#x548C;&#x7070;&#x5EA6;&#x529F;&#x80FD;&#xFF0C;&#x5B58;&#x50A8;&#x5F00;&#x53D1;&#x8005;&#x4E0A;&#x4F20;&#x7684;&#x8865;&#x4E01;&#x5305;&#x3002;</li>
</ul>
<h3 id="&#x5176;&#x4ED6;&#x70ED;&#x4FEE;&#x590D;&#x65B9;&#x6848;"><a href="#&#x5176;&#x4ED6;&#x70ED;&#x4FEE;&#x590D;&#x65B9;&#x6848;" class="headerlink" title="&#x5176;&#x4ED6;&#x70ED;&#x4FEE;&#x590D;&#x65B9;&#x6848;"></a>&#x5176;&#x4ED6;&#x70ED;&#x4FEE;&#x590D;&#x65B9;&#x6848;</h3><table>
<thead>
<tr>
<th>&#x65B9;&#x6848;</th>
<th>&#x4F5C;&#x8005;</th>
</tr>
</thead>
<tbody>
<tr>
<td><a href="https://github.com/Tencent/tinker" target="_blank" rel="noopener">Tinker</a></td>
<td>&#x5FAE;&#x4FE1;(apk&#x8865;&#x4E01;)</td>
</tr>
<tr>
<td><a href="https://github.com/Meituan-Dianping/Robust" target="_blank" rel="noopener">Robust</a></td>
<td>&#x7F8E;&#x56E2;</td>
</tr>
<tr>
<td><a href="https://github.com/eleme/Amigo" target="_blank" rel="noopener">Amigo</a></td>
<td>&#x997F;&#x4E86;&#x4E48;&#xFF08;apk&#x8865;&#x4E01;&#xFF09;</td>
</tr>
<tr>
<td><a href="https://github.com/jasonross/Nuwa" target="_blank" rel="noopener">Nuwa</a></td>
<td>&#x4E2A;&#x4EBA;&#x5F00;&#x53D1;&#x8005;</td>
</tr>
<tr>
<td><a href="https://github.com/alibaba/dexposed" target="_blank" rel="noopener">Dexposed</a></td>
<td></td>
</tr>
<tr>
<td><a href="https://github.com/dodola/RocooFix" target="_blank" rel="noopener">RocooFix</a></td>
<td>&#x4E2A;&#x4EBA;&#x5F00;&#x53D1;&#x8005;</td>
</tr>
</tbody>
</table>
<h2 id="&#x96C6;&#x6210;Sophix"><a href="#&#x96C6;&#x6210;Sophix" class="headerlink" title="&#x96C6;&#x6210;Sophix"></a>&#x96C6;&#x6210;Sophix</h2><h3 id="&#x6CE8;&#x518C;&#x963F;&#x91CC;&#x4E91;&#x8D26;&#x53F7;"><a href="#&#x6CE8;&#x518C;&#x963F;&#x91CC;&#x4E91;&#x8D26;&#x53F7;" class="headerlink" title="&#x6CE8;&#x518C;&#x963F;&#x91CC;&#x4E91;&#x8D26;&#x53F7;"></a>&#x6CE8;&#x518C;<a href="https://www.aliyun.com" target="_blank" rel="noopener">&#x963F;&#x91CC;&#x4E91;</a>&#x8D26;&#x53F7;</h3><p><strong><a href="https://help.aliyun.com/document_detail/53238.html?spm=5176.doc53240.3.2.xk9U86" target="_blank" rel="noopener">&#x521B;&#x5EFA;App&#x6587;&#x6863;&#x4F20;&#x9001;&#x95E8;</a></strong></p>
<ul>
<li>&#x6CE8;&#x518C;&#x5B8C;&#x5F00;&#x53D1;&#x8005;&#x8D26;&#x53F7;&#xFF0C;&#x6210;&#x529F;&#x767B;&#x5F55;&#x540E;&#x8FDB;&#x5165;&#x63A7;&#x5236;&#x53F0;&#xFF0C;&#x6DFB;&#x52A0;&#x79FB;&#x52A8;&#x70ED;&#x4FEE;&#x590D;&#x670D;&#x52A1;&#x3002;<br><img src="http://cdn.tiimor.cn/images/%E6%B7%BB%E5%8A%A0%E7%A7%BB%E5%8A%A8%E7%83%AD%E4%BF%AE%E5%A4%8D.png" alt="&#x6DFB;&#x52A0;&#x79FB;&#x52A8;&#x70ED;&#x4FEE;&#x590D;"></li>
</ul>
<ul>
<li><p>&#x5F00;&#x901A;&#x70ED;&#x4FEE;&#x590D;&#x670D;&#x52A1;&#x540E;&#xFF0C;&#x8DF3;&#x8F6C;&#x5230;&#x70ED;&#x4FEE;&#x590D;&#x4EA7;&#x54C1;&#x754C;&#x9762;-<strong>App&#x7BA1;&#x7406;</strong>&#xFF0C;&#x521B;&#x5EFA;App &#x201C;Sophix&#x6D4B;&#x8BD5;&#x201D;&#xFF0C;&#x521B;&#x5EFA;&#x5B8C;&#x6210;&#x540E;&#x4F1A;&#x51FA;&#x73B0;&#x4E24;&#x4E2A;&#x5E73;&#x53F0;&#x7684;App&#x5217;&#x8868;&#xFF1A;iOS&#x548C;Android<br><img src="http://cdn.tiimor.cn/images/Sophix%E6%B5%8B%E8%AF%95.png" alt="Sophix&#x6D4B;&#x8BD5;"></p>
</li>
<li><p>&#x70B9;&#x51FB;&#x7BA1;&#x7406;&#x8FDB;&#x5165;Android&#x5E73;&#x53F0;&#xFF0C;&#x5728;&#x5BA2;&#x6237;&#x7AEF;&#x91CC;&#xFF0C;&#x9700;&#x8981;&#x4F7F;&#x7528;&#x5230;AppId&#x3001;APPSecret&#x3001;RSA&#x5BC6;&#x94A5;<br><img src="http://cdn.tiimor.cn/images/Sophix%E5%BF%85%E8%A6%81%E4%BF%A1%E6%81%AF.png" alt="Sophix&#x5FC5;&#x8981;&#x4FE1;&#x606F;"></p>
</li>
</ul>
<h3 id="&#x5BA2;&#x6237;&#x7AEF;&#x96C6;&#x6210;"><a href="#&#x5BA2;&#x6237;&#x7AEF;&#x96C6;&#x6210;" class="headerlink" title="&#x5BA2;&#x6237;&#x7AEF;&#x96C6;&#x6210;"></a>&#x5BA2;&#x6237;&#x7AEF;&#x96C6;&#x6210;</h3><p><strong><a href="https://help.aliyun.com/document_detail/53240.html?spm=5176.doc53287.2.1.xLNLZz#1.1%20Android%20SDK%E5%8F%8A%E5%B7%A5%E5%85%B7%E4%B8%8B%E8%BD%BD" target="_blank" rel="noopener">Sophix&#x6587;&#x6863;&#x4F20;&#x9001;&#x95E8;</a></strong></p>
<ul>
<li><p>&#x5F15;&#x5165;maven&#x4F9D;&#x8D56;&#x4ED3;&#x5E93;<br>&#x5728;&#x9879;&#x76EE;app&#x4E0B;&#x7684;build.gradle&#x4E2D;&#x6DFB;&#x52A0;maven&#x4ED3;&#x5E93;&#x5730;&#x5740;&#x548C;&#x7248;&#x672C;&#x4F9D;&#x8D56;</p>
<ul>
<li><p>&#x6DFB;&#x52A0;maven&#x4ED3;&#x5E93;&#x5730;&#x5740;&#xFF1A;</p>
<figure class="highlight nginx"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"><span class="section">repositories</span> {</span><br><span class="line">   <span class="section">maven</span> {</span><br><span class="line">       <span class="attribute">url</span> <span class="string">&quot;http://maven.aliyun.com/nexus/content/repositories/releases&quot;</span></span><br><span class="line">   }</span><br><span class="line">}</span><br></pre></td></tr></tbody></table></figure>
</li>
<li><p>&#x6DFB;&#x52A0;&#x4F9D;&#x8D56;&#xFF1A;</p>
<figure class="highlight gradle"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">compile</span> <span class="string">&apos;com.aliyun.ams:alicloud-android-hotfix:3.1.2&apos;</span></span><br></pre></td></tr></tbody></table></figure>
</li>
</ul>
</li>
</ul>
<p><img src="http://cdn.tiimor.cn/images/%E5%BC%95%E5%85%A5Sophix%E4%BB%93%E5%BA%93.png" alt="&#x5F15;&#x5165;Sophix&#x4F9D;&#x8D56;"></p>
<ul>
<li><p>&#x6DFB;&#x52A0;&#x4F7F;&#x7528;&#x6743;&#x9650;</p>
<figure class="highlight applescript"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">&lt;! <span class="comment">-- &#x7F51;&#x7EDC;&#x6743;&#x9650; --&gt;</span></span><br><span class="line">&lt;uses-permission android:<span class="built_in">name</span>=<span class="string">&quot;android.permission.INTERNET&quot;</span> /&gt;</span><br><span class="line">&lt;uses-permission android:<span class="built_in">name</span>=<span class="string">&quot;android.permission.ACCESS_NETWORK_STATE&quot;</span> /&gt;</span><br><span class="line">&lt;uses-permission android:<span class="built_in">name</span>=<span class="string">&quot;android.permission.ACCESS_WIFI_STATE&quot;</span> /&gt;</span><br><span class="line">&lt;! <span class="comment">-- &#x5916;&#x90E8;&#x5B58;&#x50A8;&#x8BFB;&#x6743;&#x9650;&#xFF0C;&#x8C03;&#x8BD5;&#x5DE5;&#x5177;&#x52A0;&#x8F7D;&#x672C;&#x5730;&#x8865;&#x4E01;&#x9700;&#x8981; --&gt;</span></span><br><span class="line">&lt;uses-permission android:<span class="built_in">name</span>=<span class="string">&quot;android.permission.READ_EXTERNAL_STORAGE&quot;</span>/&gt;</span><br></pre></td></tr></tbody></table></figure>
</li>
<li><p>&#x914D;&#x7F6E;AndroidManifest&#x6587;&#x4EF6;<br>&#x5728;application&#x8282;&#x70B9;&#x91CC;&#x6DFB;&#x52A0;&#x914D;&#x7F6E;&#xFF0C;&#x7528;&#x4E4B;&#x524D;&#x5728;&#x963F;&#x91CC;&#x4E91;&#x4E0A;&#x521B;&#x5EFA;&#x7684;App&#x7684;&#x914D;&#x7F6E;&#x4FE1;&#x606F;AppId&#x3001;APPSecret&#x3001;RSA&#x5BC6;&#x94A5;&#x66FF;&#x6362;value&#x7684;&#x503C;&#xFF1A;</p>
<figure class="highlight haskell"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line">&lt;application&gt;</span><br><span class="line">	&lt;meta-<span class="class"><span class="keyword">data</span></span></span><br><span class="line">	android:name=<span class="string">&quot;com.taobao.android.hotfix.IDSECRET&quot;</span></span><br><span class="line">	android:value=<span class="string">&quot;App ID&quot;</span> /&gt;</span><br><span class="line">	&lt;meta-<span class="class"><span class="keyword">data</span></span></span><br><span class="line">	android:name=<span class="string">&quot;com.taobao.android.hotfix.APPSECRET&quot;</span></span><br><span class="line">	android:value=<span class="string">&quot;App Secret&quot;</span> /&gt;</span><br><span class="line">	&lt;meta-<span class="class"><span class="keyword">data</span></span></span><br><span class="line">	android:name=<span class="string">&quot;com.taobao.android.hotfix.RSASECRET&quot;</span></span><br><span class="line">	android:value=<span class="string">&quot;RSA&#x5BC6;&#x94A5;&quot;</span> /&gt;</span><br><span class="line">	&#xB7;&#xB7;&#xB7;</span><br><span class="line">&lt;/application&gt;</span><br></pre></td></tr></tbody></table></figure>
</li>
</ul>
<p>&#x53EF;&#x53C2;&#x8003;&#x5B98;&#x65B9;&#x7684;&#x52A8;&#x56FE;&#x793A;&#x4F8B;&#xFF1A;<br><img src="http://cdn.tiimor.cn/images/gif-Sophix.gif" alt="gif-Sophix"></p>
<ul>
<li>Application&#x63A5;&#x5165;SDK<br>&#x5176;&#x4ED6;&#x63A5;&#x53E3;&#x4F7F;&#x7528;&#x8BF7;&#x67E5;&#x770B;SDK&#x6587;&#x6863;<figure class="highlight processing"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">/**</span></span><br><span class="line"><span class="comment"> * &#x521D;&#x59CB;&#x5316;Sophix</span></span><br><span class="line"><span class="comment"> */</span></span><br><span class="line"><span class="keyword">private</span> <span class="keyword">void</span> initSophix()</span><br><span class="line">{</span><br><span class="line">	<span class="keyword">String</span> appVersion;</span><br><span class="line">	<span class="keyword">try</span></span><br><span class="line">	{</span><br><span class="line">		appVersion = getPackageManager().getPackageInfo(getPackageName(), <span class="number">0</span>).versionName;</span><br><span class="line">	}</span><br><span class="line">	<span class="keyword">catch</span> (Exception e)</span><br><span class="line">	{</span><br><span class="line">		e.printStackTrace();</span><br><span class="line">		appVersion = <span class="string">&quot;1.0.0&quot;</span>;</span><br><span class="line">	}</span><br><span class="line">	SophixManager.getInstance().setContext(<span class="keyword">this</span>).setAppVersion(appVersion).setAesKey(<span class="keyword">null</span>).setEnableDebug(<span class="keyword">true</span>).setPatchLoadStatusStub(<span class="keyword">new</span> PatchLoadStatusListener()</span><br><span class="line">	{</span><br><span class="line">		@Override</span><br><span class="line">		<span class="keyword">public</span> <span class="keyword">void</span> onLoad(<span class="keyword">final</span> <span class="built_in">int</span> mode, <span class="keyword">final</span> <span class="built_in">int</span> code, <span class="keyword">final</span> <span class="keyword">String</span> info, <span class="keyword">final</span> <span class="built_in">int</span> handlePatchVersion)</span><br><span class="line">		{</span><br><span class="line">			<span class="comment">// &#x8865;&#x4E01;&#x52A0;&#x8F7D;&#x56DE;&#x8C03;&#x4FE1;&#x606F;</span></span><br><span class="line">			StringBuilder msg = <span class="keyword">new</span> StringBuilder();</span><br><span class="line">			msg.<span class="built_in">append</span>(<span class="string">&quot;Mode:&quot;</span>).<span class="built_in">append</span>(mode).<span class="built_in">append</span>(<span class="string">&quot;\n&quot;</span>);</span><br><span class="line">			msg.<span class="built_in">append</span>(<span class="string">&quot;Code:&quot;</span>).<span class="built_in">append</span>(code).<span class="built_in">append</span>(<span class="string">&quot;\n&quot;</span>);</span><br><span class="line">			msg.<span class="built_in">append</span>(<span class="string">&quot;Info:&quot;</span>).<span class="built_in">append</span>(info).<span class="built_in">append</span>(<span class="string">&quot;\n&quot;</span>);</span><br><span class="line">			msg.<span class="built_in">append</span>(<span class="string">&quot;HandlePatchVersion:&quot;</span>).<span class="built_in">append</span>(handlePatchVersion).<span class="built_in">append</span>(<span class="string">&quot;\n&quot;</span>);</span><br><span class="line">			<span class="keyword">if</span> (mDisplayListener != <span class="keyword">null</span>)</span><br><span class="line">				mDisplayListener.handle(msg.toString());</span><br><span class="line"></span><br><span class="line">			<span class="comment">// &#x8865;&#x4E01;&#x52A0;&#x8F7D;&#x56DE;&#x8C03;&#x901A;&#x77E5;</span></span><br><span class="line">			<span class="keyword">switch</span> (code)</span><br><span class="line">			{</span><br><span class="line">			<span class="keyword">case</span> PatchStatus.CODE_LOAD_SUCCESS:</span><br><span class="line">				<span class="comment">// &#x8868;&#x660E;&#x8865;&#x4E01;&#x52A0;&#x8F7D;&#x6210;&#x529F;</span></span><br><span class="line">				<span class="keyword">break</span>;</span><br><span class="line"></span><br><span class="line">			<span class="keyword">case</span> PatchStatus.CODE_LOAD_RELAUNCH:</span><br><span class="line">				<span class="comment">// &#x8868;&#x660E;&#x65B0;&#x8865;&#x4E01;&#x751F;&#x6548;&#x9700;&#x8981;&#x91CD;&#x542F;. &#x5F00;&#x53D1;&#x8005;&#x53EF;&#x63D0;&#x793A;&#x7528;&#x6237;&#x6216;&#x8005;&#x5F3A;&#x5236;&#x91CD;&#x542F;;</span></span><br><span class="line">				<span class="comment">// &#x5EFA;&#x8BAE;: &#x7528;&#x6237;&#x53EF;&#x4EE5;&#x76D1;&#x542C;&#x8FDB;&#x5165;&#x540E;&#x53F0;&#x4E8B;&#x4EF6;&#xFF0C;&#x7136;&#x540E;&#x8C03;&#x7528;killProcessSafely&#x81EA;&#x6740;</span></span><br><span class="line">				<span class="comment">// &#x6CE8;&#x610F;&#xFF1A;&#x4E0D;&#x53EF;&#x4EE5;&#x76F4;&#x63A5;Process.killProcess(Process.myPid())&#x6765;&#x6740;&#x8FDB;&#x7A0B;&#xFF0C;&#x8FD9;&#x6837;&#x4F1A;&#x6270;&#x4E71;Sophix&#x7684;&#x5185;&#x90E8;&#x72B6;&#x6001;&#x3002;</span></span><br><span class="line">				<span class="keyword">break</span>;</span><br><span class="line"></span><br><span class="line">			<span class="keyword">case</span> PatchStatus.CODE_LOAD_FAIL:</span><br><span class="line">				<span class="comment">// &#x5185;&#x90E8;&#x5F15;&#x64CE;&#x5F02;&#x5E38;&#xFF0C;&#x63A8;&#x8350;&#x6B64;&#x65F6;&#x6E05;&#x7A7A;&#x672C;&#x5730;&#x8865;&#x4E01;&#xFF0C;&#x9632;&#x6B62;&#x5931;&#x8D25;&#x8865;&#x4E01;&#x91CD;&#x590D;&#x52A0;&#x8F7D;</span></span><br><span class="line">				SophixManager.getInstance().cleanPatches();</span><br><span class="line">				<span class="keyword">break</span>;</span><br><span class="line"></span><br><span class="line">			<span class="keyword">default</span>:</span><br><span class="line">				<span class="comment">// &#x5176;&#x5B83;&#x9519;&#x8BEF;&#x4FE1;&#x606F;&#xFF0C;&#x67E5;&#x770B;PatchStatus&#x7C7B;&#x8BF4;&#x660E;</span></span><br><span class="line">				<span class="keyword">break</span>;</span><br><span class="line">			}</span><br><span class="line">		}</span><br><span class="line">	}).initialize();</span><br><span class="line">	<span class="comment">// &#x52A0;&#x8F7D;&#x65B0;&#x7684;&#x8865;&#x4E01;&#x5305;</span></span><br><span class="line">	SophixManager.getInstance().queryAndLoadNewPatch();</span><br><span class="line">}</span><br></pre></td></tr></tbody></table></figure>
</li>
</ul>
<p>&#x81F3;&#x6B64;&#xFF0C;Sophix&#x914D;&#x7F6E;&#x5B8C;&#x6210;&#x3002;</p>
<h3 id="&#x6D4B;&#x8BD5;"><a href="#&#x6D4B;&#x8BD5;" class="headerlink" title="&#x6D4B;&#x8BD5;"></a>&#x6D4B;&#x8BD5;</h3><ul>
<li>&#x5BA2;&#x6237;&#x7AEF;&#x7B2C;&#x4E00;&#x7248;&#x672C;&#xFF0C;&#x5982;&#x56FE;&#xFF0C;&#x6253;&#x5305;&#x6210;Sophix_V1.apk<br><img src="http://cdn.tiimor.cn/images/Sophix_V1.png" alt="Sophix_V1"></li>
</ul>
<ul>
<li><p>&#x5BA2;&#x6237;&#x7AEF;&#x8865;&#x4E01;&#x7248;&#x672C;&#xFF0C;&#x5982;&#x56FE;&#xFF0C;&#x6253;&#x5305;&#x6210;Sophix_V2.apk<br><img src="http://cdn.tiimor.cn/images/Sophix_V2.png" alt="Sophix_V2"></p>
</li>
<li><p>&#x751F;&#x6210;&#x8865;&#x4E01;&#xFF0C;<a href="https://help.aliyun.com/document_detail/53247.html?spm=5176.2020520107.0.0.719a83830VCANh" target="_blank" rel="noopener">&#x751F;&#x6210;&#x8865;&#x4E01;&#x6587;&#x6863;&#x4F20;&#x9001;&#x95E8;</a><br>Windows&#x4E0B;&#x8F7D;&#x963F;&#x91CC;&#x8865;&#x4E01;&#x5DE5;&#x5177;<a href="http://ams-hotfix-repo.oss-cn-shanghai.aliyuncs.com/SophixPatchTool_windows.zip?spm=5176.doc53247.2.2.lz640u&amp;file=SophixPatchTool_windows.zip" target="_blank" rel="noopener">SophixPatchTool</a>&#xFF0C;&#x8FD0;&#x884C;SophixPatchTool.exe&#xFF0C;&#x6DFB;&#x52A0;&#x5305;&#xFF0C;&#x5982;&#x679C;&#x6709;&#x7B7E;&#x540D;&#x7B49;&#x8BBE;&#x7F6E;&#xFF0C;&#x5219;&#x70B9;&#x51FB;&#x8BBE;&#x7F6E;&#xFF0C;&#x914D;&#x7F6E;&#x76F8;&#x5E94;&#x7684;&#x7B7E;&#x540D;&#x7B49;&#xFF0C;&#x7136;&#x540E;&#x70B9;&#x51FB;&#x201C;Go&#x201D;&#xFF0C;&#x751F;&#x6210;&#x8865;&#x4E01;&#xFF0C;&#x5373;<strong>sophix-patch.jar</strong>&#xFF1A;<br><img src="http://cdn.tiimor.cn/images/Sophix%E8%A1%A5%E4%B8%81%E7%94%9F%E6%88%90.png" alt="Sophix&#x8865;&#x4E01;&#x751F;&#x6210;" title="&#x751F;&#x6210;&#x8865;&#x4E01;"></p>
</li>
<li><p>&#x4E0A;&#x4F20;&#x8865;&#x4E01;<br>&#x8FDB;&#x5165;&#x963F;&#x91CC;&#x4E91;&#x70ED;&#x4FEE;&#x590D;App&#x7BA1;&#x7406;&#x7684;Android&#x5E73;&#x53F0;&#x91CC;&#xFF0C;&#x5373;&#x67E5;&#x770B;AppId&#x3001;APPSecret&#x3001;RSA&#x5BC6;&#x94A5;&#x90A3;&#x4E2A;&#x9875;&#x9762;&#xFF0C;&#x6DFB;&#x52A0;&#x65B0;&#x7248;&#x672C;&#xFF0C;&#x6210;&#x529F;&#x6DFB;&#x52A0;&#x7248;&#x672C;&#x540E;&#xFF0C;&#x70B9;&#x51FB;&#x67E5;&#x770B;&#x8BE6;&#x60C5;&#x8FDB;&#x5165;&#xFF0C;&#x4E0A;&#x4F20;&#x521A;&#x521A;&#x751F;&#x6210;&#x7684;sophix-patch.jar&#x8865;&#x4E01;&#x3002;<br><img src="http://cdn.tiimor.cn/images/Sophix%E6%B7%BB%E5%8A%A0%E8%A1%A5%E4%B8%81%E7%89%88%E6%9C%AC.png" alt="Sophix&#x6DFB;&#x52A0;&#x8865;&#x4E01;&#x7248;&#x672C;" title="&#x6DFB;&#x52A0;&#x8865;&#x4E01;&#x7248;&#x672C;"><br><img src="http://cdn.tiimor.cn/images/Sophix%E4%B8%8A%E4%BC%A0%E8%A1%A5%E4%B8%81.png" alt="Sophix&#x4E0A;&#x4F20;&#x8865;&#x4E01;" title="&#x4E0A;&#x4F20;&#x8865;&#x4E01;"></p>
</li>
<li><p>&#x672C;&#x5730;&#x6D4B;&#x8BD5;<br>&#x5B89;&#x88C5;Sophix_V1.apk&#xFF0C;&#x540C;&#x65F6;&#x5C06;&#x8865;&#x4E01;sophix-patch.jar&#x653E;&#x5230;Android&#x8BBE;&#x5907;&#x7684;&#x76EE;&#x5F55;&#x91CC;&#xFF1A;<code>/sdcard/sophix-patch.jar</code>&#xFF0C;&#x4E0B;&#x8F7D;<a href="http://ams-hotfix-repo.oss-cn-shanghai.aliyuncs.com/hotfix_debug_tool-release.apk?spm=5176.2020520107.0.0.719a8383MbMrkQ&amp;file=hotfix_debug_tool-release.apk" target="_blank" rel="noopener">hotfixdebug</a>&#x5DE5;&#x5177;&#xFF0C;&#x5B89;&#x88C5;&#x540E;&#xFF0C;&#x6253;&#x5F00;&#x8FDB;&#x5165;&#x8C03;&#x8BD5;apk&#xFF0C;&#x914D;&#x7F6E;&#x5982;&#x4E0B;&#xFF1A;<br><img src="http://cdn.tiimor.cn/images/Sophix%E6%9C%AC%E5%9C%B0%E6%B5%8B%E8%AF%95.png" alt="Sophix&#x672C;&#x5730;&#x6D4B;&#x8BD5;"></p>
</li>
</ul>
<p>&#x6D4B;&#x8BD5;&#x6210;&#x529F;<br><img src="http://cdn.tiimor.cn/images/Sophix%E6%9C%AC%E5%9C%B0%E6%B5%8B%E8%AF%95%E6%88%90%E5%8A%9F.png" alt="Sophix&#x672C;&#x5730;&#x6D4B;&#x8BD5;&#x6210;&#x529F;"></p>
<ul>
<li>&#x53D1;&#x5E03;<br>&#x8FDB;&#x5165;&#x963F;&#x91CC;&#x4E91;&#x7684;&#x8865;&#x4E01;&#x8BE6;&#x60C5;&#x9875;&#x9762;&#xFF0C;&#x70B9;&#x51FB;&#x53D1;&#x5E03;&#x3002;&#x518D;&#x6B21;&#x8FDB;&#x884C;&#x8C03;&#x8BD5;&#xFF0C;&#x8FD9;&#x6B21;&#x4E0D;&#x7528;Sophix&#x8C03;&#x8BD5;&#x5DE5;&#x5177;&#xFF1B;&#x5148;&#x5378;&#x8F7D;&#x5DF2;&#x5B89;&#x88C5;&#x7684;Sophix_V1&#xFF0C;&#x91CD;&#x65B0;&#x5B89;&#x88C5;&#xFF0C;&#x6253;&#x5F00;&#x540E;&#x518D;&#x6B21;&#x7B49;&#x5F85;&#x68C0;&#x6D4B;&#x8865;&#x4E01;&#x66F4;&#x65B0;&#xFF0C;&#x518D;&#x6B21;&#x51FA;&#x73B0;&#x63D0;&#x793A;ok&#x3002;<br><img src="http://cdn.tiimor.cn/images/Sophix%E5%8F%91%E5%B8%83.png" alt="Sophix&#x53D1;&#x5E03;"></li>
</ul>
<h2 id="&#x63A8;&#x5E7F;"><a href="#&#x63A8;&#x5E7F;" class="headerlink" title="&#x63A8;&#x5E7F;"></a>&#x63A8;&#x5E7F;</h2><p>&#x6709;&#x5174;&#x8DA3;&#x7684;&#x7AE5;&#x978B;&#x53EF;&#x4EE5;&#x770B;&#x770B;&#x963F;&#x91CC;&#x51FA;&#x54C1;&#x7684;<strong><a href="http://note.youdao.com/noteshare?id=1c2b949de5e966ecaf37b363500e6491&amp;sub=3CAAE8571EC74E4B99C841DD208C23CC" target="_blank" rel="noopener">&#x70ED;&#x4FEE;&#x590D;&#x539F;&#x7406;&#x5B9D;&#x5178;</a></strong></p>
<script src="//cdn.bootcss.com/jquery.lazyload/1.9.1/jquery.lazyload.min.js"></script><div class="hexo-img-readStream"><style type="text/css">.hexo-image-stream-lazy {display:block;}.hexo-img-readStream{width:100%;max-width:1100px;margin:3% auto}div.hexo-img-readStream readItems{ background: #fefefe;box-shadow: 0 1px 2px rgba(34, 25, 25, 0.2);margin: 0 1% 3%;padding: 3%;padding-bottom: 9px;display: inline-block;max-width: 25%;}div.hexo-img-readStream readItems img{padding-bottom:10px;margin-top: 0.7em;}div.hexo-img-readStream readItems figcaption{font-size:.8rem;color:#999;line-height:1.5;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align: center;}div.hexo-img-readStream small{font-size:1rem;float:right;text-transform:uppercase;color:#aaa}div.hexo-img-readStream small a{color:#666;text-decoration:none;transition:.4s color}@media screen and (max-width:750px){.hexo-img-readStream{column-gap:0}}</style>
<readitems><a href="http://cdn.tiimor.cn/images/%E9%98%BF%E9%87%8C%E7%83%AD%E4%BF%AE%E5%A4%8D%E5%8E%9F%E7%90%86%E5%AE%9D%E5%85%B8.png" target="_blank" rel="external"><img class="hexo-image-stream-lazy nofancy" src="//ww4.sinaimg.cn/large/e724cbefgw1etyppy7bgwg2001001017.gif" data-original="http://cdn.tiimor.cn/images/%E9%98%BF%E9%87%8C%E7%83%AD%E4%BF%AE%E5%A4%8D%E5%8E%9F%E7%90%86%E5%AE%9D%E5%85%B8.png"><noscript><img src="http://cdn.tiimor.cn/images/%E9%98%BF%E9%87%8C%E7%83%AD%E4%BF%AE%E5%A4%8D%E5%8E%9F%E7%90%86%E5%AE%9D%E5%85%B8.png"></noscript></a><figcaption><a href="http://note.youdao.com/noteshare?id=1c2b949de5e966ecaf37b363500e6491&amp;sub=3CAAE8571EC74E4B99C841DD208C23CC" target="_blank" rel="external" id="favorite">&#x963F;&#x91CC;&#x70ED;&#x4FEE;&#x590D;&#x539F;&#x7406;&#x5B9D;&#x5178;</a></figcaption></readitems> 
</div><script type="text/javascript">$('img.hexo-image-stream-lazy').lazyload({ effect:'fadeIn' });</script>
<script>
        document.querySelectorAll('.github-emoji')
          .forEach(el => {
            if (!el.dataset.src) { return; }
            const img = document.createElement('img');
            img.style = 'display:none !important;';
            img.src = el.dataset.src;
            img.addEventListener('error', () => {
              img.remove();
              el.style.color = 'inherit';
              el.style.backgroundImage = 'none';
              el.style.background = 'none';
            });
            img.addEventListener('load', () => {
              img.remove();
            });
            document.body.appendChild(img);
          });
      </script>
      
    </div>
    
    
    

    

    
      <div>
        <div style="padding: 10px 0; margin: 20px auto; width: 90%; text-align: center;">
  <div>谢谢老板，请尽情用红包来蹂躏我吧！！！</div>
  <button id="rewardButton" disable="enable" onclick="var qr = document.getElementById('QR'); if (qr.style.display === 'none') {qr.style.display='block';} else {qr.style.display='none'}">
    <span>赏</span>
  </button>
  <div id="QR" style="display: none;">

    
      <div id="wechat" style="display: inline-block">
        <img id="wechat_qr" src="/uploads/wechatpay.jpg" alt="Tiimor 微信打赏">
        <p>微信打赏</p>
      </div>
    

    
      <div id="alipay" style="display: inline-block">
        <img id="alipay_qr" src="/uploads/alipay.jpg" alt="Tiimor 支付宝打赏">
        <p>支付宝打赏</p>
      </div>
    

    

  </div>
</div>

      </div>
    

    

    <footer class="post-footer">
      
        <div class="post-tags">
          
            <!-- modify by zhangwei -->
            <!-- 文章底部标签图标 -->
            <a href="/tags/Android/" rel="tag"><i class="menu-item-icon fa fa-tag fa-fw"></i>Android</a>
          
            <!-- modify by zhangwei -->
            <!-- 文章底部标签图标 -->
            <a href="/tags/热修复/" rel="tag"><i class="menu-item-icon fa fa-tag fa-fw"></i>热修复</a>
          
            <!-- modify by zhangwei -->
            <!-- 文章底部标签图标 -->
            <a href="/tags/Sophix/" rel="tag"><i class="menu-item-icon fa fa-tag fa-fw"></i>Sophix</a>
          
        </div>
      

      
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/Java编译注解-自动生成代码/" rel="next" title="Java编译注解-自动生成代码">
                <i class="fa fa-chevron-left"></i> Java编译注解-自动生成代码
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/Android-DIY-ShimmerTextView/" rel="prev" title="Android-DIY-ShimmerTextView">
                Android-DIY-ShimmerTextView <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </div>
  
  
  
  </article>



    <div class="post-spread">
      
    </div>
  </div>


          </div>
          


          

  
    <div class="comments" id="comments">
      
        <div id="gitment-container"></div>
      
    </div>

  



        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap">
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview-wrap">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview-wrap sidebar-panel">
        <div class="site-overview">
          <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
            
              <img class="site-author-image" itemprop="image" src="/uploads/avatar.jpg" alt="Tiimor">
            
              <p class="site-author-name" itemprop="name">Tiimor</p>
              <p class="site-description motion-element" itemprop="description">安静地做一只攻城狮。</p>
          </div>

          <nav class="site-state motion-element">

            
              <div class="site-state-item site-state-posts">
              
                <a href="/archives/">
              
                  <span class="site-state-item-count">41</span>
                  <span class="site-state-item-name">日志</span>
                </a>
              </div>
            

            
              
              
              <div class="site-state-item site-state-categories">
                <a href="/categories/index.html">
                  <span class="site-state-item-count">6</span>
                  <span class="site-state-item-name">分类</span>
                </a>
              </div>
            

            
              
              
              <div class="site-state-item site-state-tags">
                <a href="/tags/index.html">
                  <span class="site-state-item-count">56</span>
                  <span class="site-state-item-name">标签</span>
                </a>
              </div>
            

          </nav>

          
            <div class="feed-link motion-element">
              <a href="/atom.xml" rel="alternate">
                <i class="fa fa-rss"></i>
                RSS
              </a>
            </div>
          

          
            <div class="links-of-author motion-element">
                
                  <span class="links-of-author-item">
                    <a href="https://github.com/VeiZhang" target="_blank" title="GitHub">
                      
                        <i class="fa fa-fw fa-github"></i>GitHub</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="http://www.weibo.com/tiimor" target="_blank" title="微博">
                      
                        <i class="fa fa-fw fa-weibo"></i>微博</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="https://juejin.im/user/589972d0570c3500624fd791" target="_blank" title="掘金">
                      
                        <i class="fa fa-fw fa-anchor"></i>掘金</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="http://www.jianshu.com/u/93b886580243" target="_blank" title="简书">
                      
                        <i class="fa fa-fw fa-book"></i>简书</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="http://wpa.qq.com/msgrd?v=3&uin=690393541&site=qq&menu=yes" target="_blank" title="QQ">
                      
                        <i class="fa fa-fw fa-qq"></i>QQ</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="mailto:tiimor@qq.com" target="_blank" title="邮箱">
                      
                        <i class="fa fa-fw fa-envelope"></i>邮箱</a>
                  </span>
                
            </div>
          

          
          

          
          

          

        </div>
      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#介绍"><span class="nav-number">1.</span> <span class="nav-text">介绍</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#“冷热”"><span class="nav-number">1.1.</span> <span class="nav-text">“冷热”</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#热修复特点"><span class="nav-number">1.2.</span> <span class="nav-text">热修复特点</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#阿里热修复方案对比"><span class="nav-number">1.3.</span> <span class="nav-text">阿里热修复方案对比</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#其他热修复方案"><span class="nav-number">1.4.</span> <span class="nav-text">其他热修复方案</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#集成Sophix"><span class="nav-number">2.</span> <span class="nav-text">集成Sophix</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#注册阿里云账号"><span class="nav-number">2.1.</span> <span class="nav-text">注册阿里云账号</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#客户端集成"><span class="nav-number">2.2.</span> <span class="nav-text">客户端集成</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#测试"><span class="nav-number">2.3.</span> <span class="nav-text">测试</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#推广"><span class="nav-number">3.</span> <span class="nav-text">推广</span></a></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright">&copy; 2017 &mdash; <span itemprop="copyrightYear">2019</span>
  <span class="with-love">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">Tiimor</span>

  
</div>


  <div class="powered-by">由 <a class="theme-link" target="_blank" href="https://hexo.io">Hexo</a> 强力驱动</div>



  <span class="post-meta-divider">|</span>



  <div class="theme-info">主题 &mdash; <a class="theme-link" target="_blank" href="https://github.com/iissnan/hexo-theme-next">NexT.Pisces</a></div>




        
<div class="busuanzi-count">
  <!-- modify by zhangwei -->
  <!-- 修改不蒜子统计脚本 -->
  <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>

  
    <span class="site-uv">
      <i class="fa fa-user"></i>
      <span class="busuanzi-value" id="busuanzi_value_site_uv"></span>
      
    </span>
  

  
    <span class="site-pv">
      <i class="fa fa-eye"></i>
      <span class="busuanzi-value" id="busuanzi_value_site_pv"></span>
      
    </span>
  
</div>



<script>
  	var _mtac = {};
  	(function() {
  		var mta = document.createElement("script");
  		mta.src = "https://pingjs.qq.com/h5/stats.js?v2.0.4";
  		mta.setAttribute("name", "MTAH5");
  		mta.setAttribute("sid", "500425805");

  		var s = document.getElementsByTagName("script")[0];
  		s.parentNode.insertBefore(mta, s);
  	})();
</script>


  <script type="text/javascript">
    (function() {
      var hm = document.createElement("script");
      hm.src = "//tajs.qq.com/stats?sId=61441764";
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(hm, s);
    })();
  </script>




        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
          <span id="scrollpercent"><span>0</span>%</span>
        
      </div>
    

    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  


  











  
  
    <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>
  

  
  
    <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>
  

  
  
    <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>
  

  
  
    <script type="text/javascript" src="/lib/canvas-nest/canvas-nest.min.js"></script>
  


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.1.4"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.1.4"></script>



  
  


  <script type="text/javascript" src="/js/src/affix.js?v=5.1.4"></script>

  <script type="text/javascript" src="/js/src/schemes/pisces.js?v=5.1.4"></script>



  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.1.4"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.1.4"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.4"></script>



  


  




	





  





  







<!-- LOCAL: You can save these files to your site and update links -->
    
        
        <link rel="stylesheet" href="https://aimingoo.github.io/gitmint/style/default.css">
        <script src="https://aimingoo.github.io/gitmint/dist/gitmint.browser.js"></script>
    
<!-- END LOCAL -->

    

    
      <script type="text/javascript">
      function renderGitment(){
        var gitment = new Gitmint({
            <!-- modify by zhangwei -->
            <!-- 修复gitment评论页初始化错误@tiimor -->
            id: '1505620330000', 
            owner: 'VeiZhang',
            repo: 'veizhang.github.io',
            
            lang: "" || navigator.language || navigator.systemLanguage || navigator.userLanguage,
            
            oauth: {
            
            
                client_secret: '9919bc61413a89ea3eb156910d282e3103093e32',
            
                client_id: 'f08924ca58e61d6f51f4'
            }});
        gitment.render('gitment-container');
      }

      
      renderGitment();
      
      </script>
    







  




  
  
  
  <link rel="stylesheet" href="/lib/algolia-instant-search/instantsearch.min.css">

  
  
  <script src="/lib/algolia-instant-search/instantsearch.min.js"></script>
  

  <script src="/js/src/algolia-search.js?v=5.1.4"></script>



  

  
  <script src="https://cdn1.lncld.net/static/js/av-core-mini-0.6.4.js"></script>
  <script>AV.initialize("7aBs9I9Y3PjoN6ueX5J3AYQW-gzGzoHsz", "kboycyzaPNAYcUW8AkF3edeW");</script>
  <script>
    function showTime(Counter) {
      var query = new AV.Query(Counter);
      var entries = [];
      var $visitors = $(".leancloud_visitors");

      $visitors.each(function () {
        entries.push( $(this).attr("id").trim() );
      });

      query.containedIn('url', entries);
      query.find()
        .done(function (results) {
          var COUNT_CONTAINER_REF = '.leancloud-visitors-count';

          if (results.length === 0) {
            $visitors.find(COUNT_CONTAINER_REF).text(0);
            return;
          }

          for (var i = 0; i < results.length; i++) {
            var item = results[i];
            var url = item.get('url');
            var time = item.get('time');
            var element = document.getElementById(url);

            $(element).find(COUNT_CONTAINER_REF).text(time);
          }
          for(var i = 0; i < entries.length; i++) {
            var url = entries[i];
            var element = document.getElementById(url);
            var countSpan = $(element).find(COUNT_CONTAINER_REF);
            if( countSpan.text() == '') {
              countSpan.text(0);
            }
          }
        })
        .fail(function (object, error) {
          console.log("Error: " + error.code + " " + error.message);
        });
    }

    function addCount(Counter) {
      var $visitors = $(".leancloud_visitors");
      var url = $visitors.attr('id').trim();
      var title = $visitors.attr('data-flag-title').trim();
      var query = new AV.Query(Counter);

      query.equalTo("url", url);
      query.find({
        success: function(results) {
          if (results.length > 0) {
            var counter = results[0];
            counter.fetchWhenSave(true);
            counter.increment("time");
            counter.save(null, {
              success: function(counter) {
                var $element = $(document.getElementById(url));
                $element.find('.leancloud-visitors-count').text(counter.get('time'));
              },
              error: function(counter, error) {
                console.log('Failed to save Visitor num, with error message: ' + error.message);
              }
            });
          } else {
            var newcounter = new Counter();
            /* Set ACL */
            var acl = new AV.ACL();
            acl.setPublicReadAccess(true);
            acl.setPublicWriteAccess(true);
            newcounter.setACL(acl);
            /* End Set ACL */
            newcounter.set("title", title);
            newcounter.set("url", url);
            newcounter.set("time", 1);
            newcounter.save(null, {
              success: function(newcounter) {
                var $element = $(document.getElementById(url));
                $element.find('.leancloud-visitors-count').text(newcounter.get('time'));
              },
              error: function(newcounter, error) {
                console.log('Failed to create');
              }
            });
          }
        },
        error: function(error) {
          console.log('Error:' + error.code + " " + error.message);
        }
      });
    }

    $(function() {
      var Counter = AV.Object.extend("Counter");
      if ($('.leancloud_visitors').length == 1) {
        addCount(Counter);
      } else if ($('.post-title-link').length > 1) {
        showTime(Counter);
      }
    });
  </script>



  

  
<script>
(function(){
    var bp = document.createElement('script');
    var curProtocol = window.location.protocol.split(':')[0];
    if (curProtocol === 'https') {
        bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';        
    }
    else {
        bp.src = 'http://push.zhanzhang.baidu.com/push.js';
    }
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(bp, s);
})();
</script>


  
  

  

  

  

  
  <!-- modify by zhangwei -->
  <!-- 动态时间小人 -->
  <!-- modify by zhangwei -->
<!-- 动态时间小人 -->
<!-- z-index -1 表示在最底层，不能悬浮也不能点击 -->
<!-- z-index auto 可以点击 -->
<!-- z-index 9999 无限大时，总是在最上层，会影响其他悬浮框 -->
<div id="dg" style="z-index: auto; position: fixed ! important; right: 0px; top: 0px;">  
    <table width 100% style="position: absolute; width:260px; right: 0px; top: 0px;">  
		<div>
			<embed wmode="transparent" src="http://cdn.tiimor.cn/images/dynamic_time.swf" quality="high" bgcolor="#ffffff" width="160" height="70" name="honehoneclock" align="middle" allowscriptaccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">
		</div>
    </table>  
</div>
  
</body>
</html>
